package dongshi.daddy.lab;

import java.util.concurrent.TimeUnit;

public class NoneDaemonThreadTest {

    public static void main(String[] args) {

        Thread noneDaemonThread = new Thread(() -> {
            while (true) {
                try {
//                    Thread.sleep(1);
                    TimeUnit.SECONDS.sleep(1);
                    System.out.println("hi,i am still running...");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        noneDaemonThread.start();

        try {
//            Thread.sleep(5);
            TimeUnit.SECONDS.sleep(2);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println("main thread exits...");

    }
}
